<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 案例一:如果小明考试超过90分,就可以去游乐场
    // 1.定义一个变量来保存小明的分数
    var score = 85
    // 2.如果分数超过了90分,则去游乐场
    if (score > 90) {
      console.log("去游乐场玩")
    }

    // 案例二:苹果单价5元/斤 如果购买的数量超过5斤,那么立减8元
    var price = 5
    var weight = 7
    var totalPrice = price * weight
    if (weight > 5) {
      totalPrice -= 8
    }
    console.log("总价格:", totalPrice)

    // 案例三:播放列表中 currentIndex
    // ["鼓楼","理想","阿刁"]
    var currentIndex = 1
    currentIndex++
    if (currentIndex === 3) {
      currentIndex = 0
    }

  </script>

</body>

</html>